export default {
  state: {
    show: false,
    options: {
      autoClose: false,
      content: ''
    }
  },
  // getters
  getters: {
    show: state => state.show,
    options: state => state.options
  },
  mutations: {
    ['TOAST_SHOW'] (state, options) {
      state.show = true
      state.options = options
    },
    ['TOAST_HIDE'] (state) {
      state.show = false
      state.options = {}
    }
  },
  actions: {
    ['TOAST_SHOW'] ({state, commit}, options) {
      commit('TOAST_SHOW', options)
    },
    ['TOAST_HIDE'] ({commit}) {
      commit('TOAST_HIDE')
    }
  }
}
